<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use PEAR2\Net\RouterOS\Client;
use PEAR2\Net\RouterOS\Util;
use PEAR2\Net\RouterOS\Query;
use PEAR2\Net\RouterOS\Request as ROSRequest;

class IndexController extends Controller
{
    public function index(Request $Request){
    	
    	try {
    		
    		$ob = new Util($client = new Client('home.webok.me','hj','hj123456',8999));
            // $client = new RouterOS\Client('home.webok.me','hj','hj123456',8999);
 
            $request = new ROSRequest('/ip/arp/print');
             
            //Define $query here
            $query = Query::where('address', '192.168.99.195',Query::OP_GT);
            $request->setQuery($query);
            $request->setArgument('.proplist', 'mac-address,address');
            $responses = $client->sendSync($request);
             
            foreach ($responses as $response) {
                var_dump($response);
                // foreach ($response as $name => $value) {
                //     echo "{$name}: {$value}<br>";
                // }
            }
    	} catch (\Exception $e) {
    		echo 'no';
    	}


    }











}
